return 2.0 * res;
}
-/* This value is the heading you'd leave point 1 at to arrive at point 2. */
+/* This value is the heading you'd leave point 1 at to arrive at point 2.
+ * Inputs and outputs are in radians.
+ */
double heading( double lat1, double lon1, double lat2, double lon2 ) {
double v1, v2;
v1 = sin(lon1 - lon2) * cos(lat2);
return atan2(v1, v2);
}
-
+/* As above, but outputs is in degrees from 0 - 359. Inputs are still radians. */
+double heading_true_degrees( double lat1, double lon1, double lat2, double lon2 )
+{
+ double h = 360.0 - DEG(heading(lat1, lon1, lat2, lon2));
+ if (h > 360) h -= 360;
+
+ return h;
+}
+
double linedist(double lat1, double lon1,
double lat2, double lon2,
double gcdist( double lat1, double lon1, double lat2, double lon2 );
double heading( double lat1, double lon1, double lat2, double lon2 );
+double heading_true_degrees( double lat1, double lon1, double lat2, double lon2 );
double linedist(double lat1, double lon1,
double lat2, double lon2,
double frac,
double *reslat, double *reslon );
-
+/* Degrees to radians */
#define DEG(x) ((x)*180.0/M_PI)
+
+/* Radians to degrees */
#define RAD(x) ((x)*M_PI/180.0)
#endif
"IFIELD URL, \"\", \"%s\" # URL\n"
"IFIELD IGNORE, \"\", \"\" # Holder for Geocache Type\n"
+;
+static char sportsim[] =
+"# gpsbabel XCSV style file\n"
+"#\n"
+"# Format: Sportsim track files\n"
+"# Author: Olaf Klein\n"
+"# Date: 07/05/2006\n"
+"#\n"
+"DESCRIPTION Sportsim track files (part of zipped .ssz files) \n"
+"EXTENSION txt\n"
+
+"#\n"
+"# FILE LAYOUT DEFINITIIONS:\n"
+"#\n"
+"FIELD_DELIMITER SEMICOLON\n"
+"RECORD_DELIMITER CRNEWLINE\n"
+"BADCHARS TAB\n"
+
+"#\n"
+"# FILE HEADER\n"
+"#\n"
+"PROLOGUE SportsimVersion:01\n"
+"PROLOGUE \\#Sportsim TrackFile\n"
+
+"#\n"
+"# INDIVIDUAL DATA FIELDS:\n"
+"#\n"
+"IFIELD INDEX, \"\", \"%05d\"\n"
+"IFIELD CONSTANT, \"0\", \"%s\"\n"
+"IFIELD LAT_DECIMAL, \"\", \"%f\"\n"
+"IFIELD LON_DECIMAL, \"\", \"%f\"\n"
+"IFIELD ALT_FEET, \"\", \"%.f\"\n"
+"IFIELD TIMET_TIME, \"\", \"%ld\"\n"
+"IFIELD CONSTANT, \";\", \"%s\"\n"
;
static char tabsep[] =
"# gpsbabel XCSV style file\n"
"IFIELD IGNORE, \"\", \"%-.31s\"\n"
"IFIELD DESCRIPTION, \"\", \"%-.78s\"\n"
;
-style_vecs_t style_list[] = {{ "xmapwpt", xmapwpt } , { "xmap", xmap } , { "xmap2006", xmap2006 } , { "tabsep", tabsep } , { "saplus", saplus } , { "s_and_t", s_and_t } , { "openoffice", openoffice } , { "nima", nima } , { "mxf", mxf } , { "mapconverter", mapconverter } , { "kwf2", kwf2 } , { "ktf2", ktf2 } , { "gpsman", gpsman } , { "gpsdrivetrack", gpsdrivetrack } , { "gpsdrive", gpsdrive } , { "geonet", geonet } , { "garmin_poi", garmin_poi } , { "garmin301", garmin301 } , { "fugawi", fugawi } , { "dna", dna } , { "custom", custom } , { "cup", cup } , { "csv", csv } , { "cambridge", cambridge } , { "arc", arc } , {0,0}};
-size_t nstyles = 25;
+style_vecs_t style_list[] = {{ "xmapwpt", xmapwpt } , { "xmap", xmap } , { "xmap2006", xmap2006 } , { "tabsep", tabsep } , { "sportsim", sportsim } , { "saplus", saplus } , { "s_and_t", s_and_t } , { "openoffice", openoffice } , { "nima", nima } , { "mxf", mxf } , { "mapconverter", mapconverter } , { "kwf2", kwf2 } , { "ktf2", ktf2 } , { "gpsman", gpsman } , { "gpsdrivetrack", gpsdrivetrack } , { "gpsdrive", gpsdrive } , { "geonet", geonet } , { "garmin_poi", garmin_poi } , { "garmin301", garmin301 } , { "fugawi", fugawi } , { "dna", dna } , { "custom", custom } , { "cup", cup } , { "csv", csv } , { "cambridge", cambridge } , { "arc", arc } , {0,0}};
+size_t nstyles = 26;
#else /* CSVFMTS_ENABLED */
style_vecs_t style_list[] = {{0,0}};
size_t nstyles = 0;